<template>
  <el-header style="height:50px;line-height:50px;color:#fff;" >
    <!-- <img src="../../assets/images/logo.png" alt="crm-logo" class="header-logo"> -->
    <span style="width: 300px; height: 50px; line-height:50px; display:inline-block;"><img height="26" style="vertical-align: middle;" src="static/images/title.png" ></span>
    <div style="float:right;font-size:14px;">
		<span style="font-size: 13px;">
			<i style="font-family:iconfont; font-style:normal; font-size: 20px;vertical-align: middle;">&#xe624;</i>
			欢迎，{{userInfo.accountName}}！
		</span>
    <a href="http://testcrm.anpxd.com/crm-web/" target="_blank" style="font-size: 13px;padding-left:10px;" >CRM管理系统</a>
      <el-dropdown placement="bottom" trigger="click">
	    <span class="el-dropdown-link" style="display:inline-block;font-size: 13px;">
	      个人中心<i class="el-icon-arrow-down el-icon--right"></i>
	    </span>
        <el-dropdown-menu slot="dropdown">
          <!--<el-dropdown-item >账号信息</el-dropdown-item>-->
          <el-dropdown-item @click.native="turnToEditPsd">修改密码</el-dropdown-item>
          <el-dropdown-item @click.native="logOut">退出登录</el-dropdown-item>
        </el-dropdown-menu>
      </el-dropdown>
    </div>
  </el-header>
</template>

<script>
  export default {
    computed:{
      userInfo(){
        return this.$sess.get('userInfo')
      }
    },
    methods:{
      logOut(){
        this.$store.commit('reset')
        this.$sess.remove('loginState');
        this.$sess.remove('userInfo');
        this.$router.push('/login');

      },
      turnToEditPsd(){
        this.$router.push('/editPassword');
      }
    }
  };
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>

</style>
